package com.ugrow.ugrowcommunity.data;


import android.util.Log;

import com.ugrow.ugrowcommunity.util.ArrayExistUtil;

import java.text.SimpleDateFormat;
import java.util.Date;


public class TimeDate {


    private static String[] chooseTime = {"06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21"};

    static Date date = new Date();
    static Date dateTwo = new Date(date.getTime() + 86400000);


    public static  String getTime() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH");
        int itime = Integer.valueOf(simpleDateFormat.format(date));
        Log.d("TAG", "getTime: "+itime);
        if(ArrayExistUtil.stringExistList(chooseTime,simpleDateFormat.format(date))){
            return (itime+1)+":00";
        }

        return "6:00";
    }

    public static String getNowaDays() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM-dd");
        return simpleDateFormat.format(date);
    }

    public static String getTommrow() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM-dd");
        return simpleDateFormat.format(dateTwo);
    }

    public static String getWeek() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("E");
        return simpleDateFormat.format(dateTwo);
    }

    public static String getYear(){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy");
        return simpleDateFormat.format(date);
    }


}
